﻿using System;
using Assist;

namespace HYRElectric.Calculate
{
	internal class StuRCR_RI
	{
		public StuRCR_RI(double dVal1, double dVal2, double dVal3, double dVal4)
		{
			this.dCeiling = dVal1;
			this.dWall = dVal2;
			this.dFloor = dVal3;
			this.dRCR_RI = dVal4;
		}

		public double Find()
		{
			StuUseFactor stuUseFactor = FindUseFactor.m_arUseFactor.Find(new Predicate<StuUseFactor>(this.Equals));
			if (stuUseFactor != null)
			{
				return stuUseFactor.dUseFactor;
			}
			return 0.0;
		}

		private bool Equals(StuUseFactor u)
		{
			return GeoUtil.IsEqual(u.dCeiling, this.dCeiling) && GeoUtil.IsEqual(u.dWall, this.dWall) && GeoUtil.IsEqual(u.dFloor, this.dFloor) && GeoUtil.IsEqual(u.dRCR_RI, this.dRCR_RI);
		}

		private double dCeiling;

		private double dWall;

		private double dFloor;

		private double dRCR_RI;
	}
}
